<template>
  <aigc-card shadow="never" header="true">
    <template #header>实时日志展示</template>
    <div>
      <aigc-scroll-table
        :autoscroll="false"
        :table-data="tableData"
        :table-columns="tableColumns"
        :show-header="false"
      >
        <template #option="scope">
          <el-button>详情</el-button>
        </template>
      </aigc-scroll-table>
    </div>
  </aigc-card>
  <!-- 实时日志展示（time\trige） -->
</template>

<script setup lang="ts">
import AigcScrollTable from "@/components/aigcTable/aigcScrollTable";
import aigcCard from "@/components/aigcCard"
import { onMounted, ref } from "vue";
import { realTimeLogDisplay } from "@/api/home/realTimeLogDisplay/realTimeLogDisplayAPI";

const tableColumns = ref([
  {
    prop: "date",
    label: "日期",
  },
  {
    prop: "output",
    label: "输出日期",
  },
  {
    prop: "option",
    slot: "option",
    label: "操作",
  },
]);
const tableData = ref([
  { date: "2023-12-01", output: "攻击" },
  { date: "2023-12-22", output: "防御" },
  { date: "2023-12-23", output: "攻击" },
  { date: "2023-12-24", output: "防御" },
  { date: "2023-12-25", output: "攻击" },
  { date: "2023-12-26", output: "防御" },
]);
onMounted(async ()=>{
  const [err,data]= await realTimeLogDisplay();
  if(!err) tableData.value= data as any
})
</script>
